import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { NestExpressApplication } from '@nestjs/platform-express';//express类型支持
import { join } from 'path';

async function bootstrap() {
  const app = await NestFactory.create<NestExpressApplication>(AppModule);
  app.useStaticAssets(join(__dirname, 'upload/images'), {//配置静态资源访问目录
    prefix: '/static'//虚拟目录
  })
  app.enableCors()
  await app.listen(3006);
}
bootstrap();
